let fs = require('fs');
let lexerAnalyze = require('./lexer-analyze/lexer-analyze-plus');
let syntaxParser = require('./syntax-parser/syntax-parser');
let commandGenerator = require('./command-generator/command-generator');

let content = fs.readFileSync('./input.txt', 'utf-8');

let lexerResult = lexerAnalyze.analyze(content);

fs.writeFileSync('./lexer-output.json', JSON.stringify(lexerResult, null, 2));

let parserResult = syntaxParser.parse(lexerResult);

fs.writeFileSync('./parser-output.json', JSON.stringify(parserResult, null, 2));

let commandResult = commandGenerator.generate(parserResult);

fs.writeFileSync('./command-output.json', JSON.stringify(commandResult, null, 2));
